test-switchroot.sh: Exclude /proc from file list
authorAlex Kiernan <alex.kiernan@gmail.com>
Sun, 29 Dec 2019 12:32:28 +0000 (12:32 +0000)
committerAlex Kiernan <alex.kiernan@gmail.com>
Sun, 29 Dec 2019 12:37:10 +0000 (12:37 +0000)
Since we're not interested in any file inside /proc, exclude it from the
file listing in our fake root thus avoiding failures when processes die
during our execution and find(1) can't then look inside those
directories.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
tests/test-switchroot.sh

index bc3ec38b5f5891f1447893b066da38d7fa335e64..b05b11a43c5d5f00404fe9b4398a12724faad85c 100755 (executable)
@@ -56,7 +56,7 @@ find_in_env() {
                "$1" "$tmpdir"
                enter_fs "$tmpdir"
                ostree-prepare-root /sysroot
-               find /
+               find / \( -path /proc -o -path /sysroot/proc \) -prune -o -print
                touch /usr/usr_writable 2>/null \
                        && echo "/usr is writable" \
                        || echo "/usr is not writable"